package com.cfswt.tasksystem.mapper;

import com.cfswt.tasksystem.pojo.entity.User;
import com.cfswt.tasksystem.pojo.vo.UserAdminVO;
import com.cfswt.tasksystem.pojo.vo.UserVO;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserMapper {
    int insertUser(User user);

    public List<User> selectAllUser();

    List<UserAdminVO> selectUserAdminVO();

    /**
     * 根据user_name查询指定的用户信息
     *
     * @param name 用户name
     * @return UserVO, 包含密码，创建日期等字段
     */
    public UserVO selectUserByName(String userName);

    /**
     * 根据id删除指定的用户记录
     *
     * @param id 用户id
     * @return 影响的记录数
     */
    int deletUserById(int id);

    int updateUser(User user);

    String selectAvatarById(int id);

    String selectUserNameByNickName(String nickName);

    Integer selectIdByNickName(String nickName);

    String selectPasswordByuserName(String userName);

    int modifyPassword(String userName, String newPassword);


}
